package com.cal.calonecal.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * @author 76004
 * @apiNote
 * @date 2023/5/20 16:00
 */
@Component
public class ExamUtil {
    @Autowired
    private RedisTemplate<String,String> redisTemplate;
    /***
     * 生成并获取试卷uid
     * @return
     */
    public Long getExamId(){
        redisTemplate.opsForValue().increment("exam_id:");
        return Long.valueOf(redisTemplate.opsForValue().get("exam_id:"));
    }
}
